/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Easy.table;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author DR.HUY
 */
@Entity
@Table(name = "Item", catalog = "EasyTicket", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Item.findAll", query = "SELECT i FROM Item i"),
    @NamedQuery(name = "Item.findByItemID", query = "SELECT i FROM Item i WHERE i.itemID = :itemID"),
    @NamedQuery(name = "Item.findByItemName", query = "SELECT i FROM Item i WHERE i.itemName = :itemName"),
    @NamedQuery(name = "Item.findByCategories", query = "SELECT i FROM Item i WHERE i.categories = :categories"),
    @NamedQuery(name = "Item.findByFromDate", query = "SELECT i FROM Item i WHERE i.fromDate = :fromDate"),
    @NamedQuery(name = "Item.findByToDate", query = "SELECT i FROM Item i WHERE i.toDate = :toDate"),
    @NamedQuery(name = "Item.findByDecription", query = "SELECT i FROM Item i WHERE i.decription = :decription"),
    @NamedQuery(name = "Item.findByStatus", query = "SELECT i FROM Item i WHERE i.status = :status"),
    @NamedQuery(name = "Item.findByImage", query = "SELECT i FROM Item i WHERE i.image = :image")})
public class Item implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ItemID", nullable = false)
    private Integer itemID;
    @Basic(optional = false)
    @Column(name = "ItemName", nullable = false, length = 50)
    private String itemName;
    @Basic(optional = false)
    @Column(name = "Categories", nullable = false, length = 50)
    private String categories;
    @Column(name = "FromDate", length = 50)
    private String fromDate;
    @Column(name = "ToDate", length = 50)
    private String toDate;
    @Column(name = "Decription", length = 50)
    private String decription;
    @Column(name = "Status", length = 10)
    private String status;
    @Column(name = "Image", length = 50)
    private String image;
    @JoinColumn(name = "PlaceID", referencedColumnName = "PlaceID", nullable = false)
    @ManyToOne(optional = false)
    private Places places;

    public Item() {
    }

    public Item(Integer itemID) {
        this.itemID = itemID;
    }

    public Item(Integer itemID, String itemName, String categories) {
        this.itemID = itemID;
        this.itemName = itemName;
        this.categories = categories;
    }

    public Integer getItemID() {
        return itemID;
    }

    public void setItemID(Integer itemID) {
        this.itemID = itemID;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getCategories() {
        return categories;
    }

    public void setCategories(String categories) {
        this.categories = categories;
    }

    public String getFromDate() {
        return fromDate;
    }

    public void setFromDate(String fromDate) {
        this.fromDate = fromDate;
    }

    public String getToDate() {
        return toDate;
    }

    public void setToDate(String toDate) {
        this.toDate = toDate;
    }

    public String getDecription() {
        return decription;
    }

    public void setDecription(String decription) {
        this.decription = decription;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Places getPlaces() {
        return places;
    }

    public void setPlaces(Places places) {
        this.places = places;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (itemID != null ? itemID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Item)) {
            return false;
        }
        Item other = (Item) object;
        if ((this.itemID == null && other.itemID != null) || (this.itemID != null && !this.itemID.equals(other.itemID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Easy.table.Item[itemID=" + itemID + "]";
    }

}
